<template>
  <div style="width: 800px; margin: 50px auto">
    <employer-info v-if="!loading" :employer="employer"/>
  </div>
</template>

<script>
import EmployerInfo from '../../../components/EmployerInfo.vue'
export default {
  name: "EmployerProfile",
  components: {
    EmployerInfo
  },
  data() {
    return {
      loading: true,
      employer: {
        name: "",
        companyName: "",
        avatarUrl: "",
        position: ""
      }
    }
  },
  created() {
    this.loading = true;
    this.axios.get("/employer/get-info?username=" + sessionStorage.getItem("username")).then(res => {
      if (res.data.code == 200) {
        this.employer['name'] = res.data.data.name;
        this.employer['companyName'] = res.data.data.company.name;
        this.employer['avatarUrl'] = res.data.data.avatarUrl
        this.employer['position'] = res.data.data.position
        this.loading = false;
      }
    })
  }
}
</script>

<style>

</style>